package com.vegetable.modules.entity.outbound;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 销售出库单
 * </p>
 *
 * @author wangruijie
 * @since 2024-04-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AllocationOutDetail对象", description="调拨出库详情")
public class AllocationInDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "生产者ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long producerId;

    @ApiModelProperty(value = "销售出库表id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long inOrderId;

    @ApiModelProperty(value = "0水果；1蔬菜")
    private Integer isFruit;

    @ApiModelProperty(value = "商品ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long commodityId;

    @ApiModelProperty(value = "商品编码")
    @TableField(exist = false)
    private String commodityCode;

    @ApiModelProperty(value = "商品名称")
    @JsonSerialize(using = ToStringSerializer.class)
    private String commodityName;

    @ApiModelProperty(value = "规格ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long specsId;

    @ApiModelProperty(value = "规格名称")
    private String specsName;

    @ApiModelProperty(value = "标准")
    private BigDecimal standard;

    @ApiModelProperty(value = "实际数量")
    private Integer number;

    @ApiModelProperty(value = "实际重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "出库数量")
    private Integer outNumber;

    @ApiModelProperty(value = "出库重量")
    private BigDecimal outWeight;

    @ApiModelProperty(value = "模式：0按重，1按件")
    private Integer mode;

    @ApiModelProperty(value = "单价")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "打包单价")
    private BigDecimal packUnitPrice;

    @ApiModelProperty(value = "成本")
    private BigDecimal cost;

    @ApiModelProperty(value = "商品金额")
    private BigDecimal goodsMoney;

    @ApiModelProperty(value = "打包金额")
    private BigDecimal packMoney;

    @ApiModelProperty(value = "商品金额+打包")
    private BigDecimal money;

    @ApiModelProperty(value = "裸价")
    private BigDecimal nakedPrice;

    @ApiModelProperty(value = "条款单价")
    private BigDecimal clauseUnitPrice;

    @ApiModelProperty(value = "条款金额")
    private BigDecimal clauseMoney;

    @ApiModelProperty(value = "包装/重")
    private BigDecimal costWeight;

    @ApiModelProperty(value = "杂费单价")
    private BigDecimal unitIncidentals;

    @ApiModelProperty(value = "到地费")
    private BigDecimal sumIncidentals;

    @ApiModelProperty(value = "扣除库存")
    @TableField(exist = false)
    private List<SalesOrderDetailStock> stocks;

    @TableField(exist = false)
    private String trainNum;

    @ApiModelProperty(value = "包装成本-销售显示")
    @TableField(exist = false)
    private double packageCostForSales = 0d;

    @ApiModelProperty(value = "蔬菜成本-销售显示")
    @TableField(exist = false)
    private BigDecimal costWeightForSales = BigDecimal.ZERO;

}
